//
//  HJRequestNet.m
//  BeautifulMatch
//
//  Created by Host on 16/2/27.
//  Copyright © 2016年 Host. All rights reserved.
//

#import "HJRequestNet.h"

#import "AFNetworking.h"

@implementation HJRequestNet


+ (void)getRequestWithURLStr:(NSString *)URLStr WithDataBlock:(void(^)(NSDictionary * allData))dataBlock isError:(void(^)(NSError * error))errorBlock {
    AFHTTPSessionManager * manager = [AFHTTPSessionManager manager];
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript",@"text/html", nil];
    [manager GET:URLStr parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        dataBlock(responseObject);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        errorBlock(error);
    }];
}
@end
